<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let money = 1000;
      while (true) {
        let choose = prompt(`
        1.存钱
        2.取钱
        3.查询余额
        4.退出
        `);
        if (choose === '4') {
          alert("退出成功");
          break;
        }
        switch (choose) {
          case "1":
            money += +prompt("请输入您要存的钱");
            alert("存钱成功，您的余额是：" + money);
            break;
          case "2":
            money -= +prompt("请输入您要取的钱");
            alert("取钱成功，您的余额是：" + money);
            break;
          case "3":
            alert("您的余额是：" + money);
            break;
          default:
            alert("输入有误，请重新输入");
        }
      }
    </script>
  </body>
</html>
